Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make search APIs consistently accept a query param #4074

Closed
clintongormley opened this issue Nov 4, 2013 · 2 comments
Closed

Make search APIs consistently accept a query param #4074

clintongormley opened this issue Nov 4, 2013 · 2 comments

Comments

@clintongormley
Copy link

The search and explain APIs both accept a query parameter in the body, while count and validate_query expect the body to be the query itself.

We should change the count and validate_query APIs to accept a query parameter. Possibly even change the count request to use the same code as for _search (with search_type=count).

@javanna
Copy link
Member

javanna commented Nov 4, 2013

I'd consider removing the current count api and make it a shortcut to a search request with search_type=count, makes sense!

@ghost ghost assigned martijnvg Dec 16, 2013
@martijnvg
Copy link
Member

I think also the delete_by_query api needs to accept the query in a query parameter instead of directly in the request body.

martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Dec 17, 2013
…ield.

The following APIs now accept the query in a top level `query` field like:
* delete_by_query
* validate_query
* count

These APIs used to accept the query directly in the request body which was inconsistent with the search and explain APIs. For this reason this is a breaking change.

Closes elastic#4074
honzakral added a commit that referenced this issue Jan 2, 2014
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
…ield.

The following APIs now accept the query in a top level `query` field like:
* delete_by_query
* validate_query
* count

These APIs used to accept the query directly in the request body which was inconsistent with the search and explain APIs. For this reason t

Closes elastic#4074
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
javanna added a commit that referenced this issue Feb 13, 2014
…vel query object, same as other apis

Relates to #4074
Closes #5111
javanna added a commit that referenced this issue Feb 13, 2014
…vel query object, same as other apis

Relates to #4074
javanna added a commit that referenced this issue Feb 13, 2014
…vel query object, same as other apis

Relates to #4074
Closes #5111
javanna added a commit that referenced this issue Feb 13, 2014
…vel query object, same as other apis

Relates to #4074
Closes #5111
javanna added a commit that referenced this issue Feb 13, 2014
javanna added a commit that referenced this issue Feb 13, 2014
javanna added a commit that referenced this issue Feb 13, 2014
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 3, 2015
This is happening because of elastic#4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes elastic#10262
s1monw added a commit that referenced this issue Jun 3, 2015
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262
s1monw added a commit that referenced this issue Jun 3, 2015
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262

Conflicts:
	src/main/java/org/elasticsearch/index/shard/IndexShard.java
	src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
s1monw added a commit that referenced this issue Jun 3, 2015
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262

Conflicts:
	src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants